package com.example.core.filter;

import com.example.core.context.GatewayContext;

/**
 * @Author Peng Yisheng
 * @Date 2024/12/1 21:34
 * @Description 过滤器链工厂接口，用于生成过滤器链
 */
public interface FilterChainFactory {
    /**
     * 构建过滤器链
     *
     * @param ctx
     * @return
     * @throws Exception
     */
    GatewayFilterChain buildFilterChain(GatewayContext ctx) throws Exception;

    /**
     * 通过过滤器ID获取过滤器
     *
     * @param filterId
     * @param <T>
     * @return
     * @throws Exception
     */
    <T> T getFilterInfo(String filterId) throws Exception;
}
